﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace ISFProject.Models
{
    public class Country
    {
        [Key]
        public int Id { get; set; }
        [Required(ErrorMessage = "name is missing")]
        [StringLength(60, MinimumLength = 3, ErrorMessage = "Invalid fieldlength")]
        public string Name { get; set; }
        [Required(ErrorMessage = "Regio is missing")]
        [StringLength(60, MinimumLength = 3, ErrorMessage = "Invalid fieldlength")]
        public string Regio { get; set; }

        [ForeignKey("Continent")]
        public int ContinentId { get; set; }
        public virtual Continent Continent { get; set; }

        public virtual List<Advertisement> Advertisements { get; set; }
    }
}